 /*
 * cuaCircular.c
 *
 *  Created on: 27/09/2011
 *      Author: Xavier Lagunas Calp<xlagunas@gmail.com>
 */

#include <stdio.h>

#define MAX_MOSTRES 16
#define modul(input, modValue) ((input) & (modValue)) 

int vector[MAX_MOSTRES]; 

int main(int arg,char **argv){
	int i=0;
	int pos_input = 0;
	for(i=0;i<64;i++){
		vector[pos_input] = i;
		//printf("vector: pos %d, valor %d.\n", pos_input,vector[pos_input]);
		pos_input = modul(pos_input+1,MAX_MOSTRES-1);
	}
	for (i=0;i<MAX_MOSTRES;i++){
		printf("vector: pos %d, valor %d.\n", i,vector[i]);
}
	return 1;
}
